reducer.js ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 0

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 0
dl 0
loc 11
rs 9.4285
nop 1
1
import { ACTION_TYPES } from './constants';
2
3
export default ({ locationParser, immutable }) => (state = immutable ? require('immutable').fromJS({}) : {}, { type, payload }) => {
4
5
    if (type === ACTION_TYPES.LOCATION_CHANGED) {
6
7
        const result = locationParser(payload);
8
9
        return immutable ? require('immutable').fromJS(result) : result;
10
    }
11
12
    return state;
13
};